Skip to content

Add EcScalar and EcPoint - #174

Merged
randombit merged 1 commit into
randombit:masterfrom
arckoor:ec-points
May 7, 2026
Merged

Add EcScalar and EcPoint#174
randombit merged 1 commit into
randombit:masterfrom
arckoor:ec-points

Conversation

@arckoor

@arckoor arckoor commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

... for when 3.12 comes around

Comment thread botan/src/lib.rs
@arckoor
arckoor force-pushed the ec-points branch 2 times, most recently from b85ae41 to ef56f85 Compare May 4, 2026 15:15
@randombit

Copy link
Copy Markdown
Owner

@arckoor Apologies, needs another rebase now

@arckoor
arckoor force-pushed the ec-points branch 5 times, most recently from 0c9dda0 to f695742 Compare May 7, 2026 07:11
@arckoor
arckoor marked this pull request as ready for review May 7, 2026 07:13
@arckoor

arckoor commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

No worries, was pretty sure it would need one either way.
I split the ec stuff into ec_group.rs and ec_point.rs, which is different from the way you did it for botan-sys. Should I put them into one file for the botan crate too?

@randombit

Copy link
Copy Markdown
Owner

Should I put them into one file for the botan crate too?

Current structure seems fine

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Rust wrappers for Botan 3.12’s new elliptic-curve scalar/point FFI types and integrates them into the existing EC group and key APIs, along with an integration test covering the new functionality.

Changes:

  • Add EcScalar and EcPoint wrappers (construction, encoding, arithmetic helpers) behind cfg(botan_ffi_20260506).
  • Extend EcGroup, Privkey, and Pubkey with new EC-focused helpers (identity/generator, EC key creation, EC group/private scalar accessors).
  • Add an integration test validating point/scalar conversions, multiplication/addition, and SEC1 encodings.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
botan/tests/tests.rs Adds coverage for EcScalar/EcPoint creation, arithmetic, and encoding/decoding under botan_ffi_20260506.
botan/src/pubkey.rs Adds EC key creation and new EC-only accessors to retrieve group and private scalar value.
botan/src/lib.rs Wires in the new ec_point module and re-exports its public API.
botan/src/ec_point.rs New module implementing EcScalar and EcPoint wrappers and basic operations/encodings.
botan/src/ec_group.rs Adds internal handle helpers and exposes identity()/generator() helpers for the new point API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread botan/src/ec_group.rs Outdated
Comment thread botan/src/ec_group.rs Outdated
Comment thread botan/src/ec_group.rs
Comment thread botan/src/ec_point.rs Outdated
@randombit

Copy link
Copy Markdown
Owner

@arckoor Copilot comments do seem relevant

@arckoor

arckoor commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Working on it already, building vendored just takes a while sometimes c;

@randombit
randombit merged commit 50771bb into randombit:master May 7, 2026
17 checks passed
@arckoor
arckoor deleted the ec-points branch May 7, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants